/* eslint-disable prettier/prettier */
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument } from 'mongoose';
import { BaseEntity } from 'src/common/schema/baseEntity.schema';

export type CommitDocument = HydratedDocument<Commit>;

@Schema({
    collection: 'Commit', // 指定集合名称
    timestamps: {
        currentTime: () => Date.now(),
        createdAt: 'createTime',
        updatedAt: 'updateTime',
    },
})
export class Commit extends BaseEntity {
    @Prop()
    commentId: string;

    @Prop()
    name: string;

    @Prop()
    star: string;

    @Prop()
    content: string;

    @Prop()
    time: string;
}

export const CommitSchema = SchemaFactory.createForClass(Commit);
